package com.wuhunyu.controller;

import com.wuhunyu.service.WeChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信登录控制器
 *
 * @author wuhunyu
 * @version 1.0
 * @date 2021-01-23 23:34
 */
@RequestMapping("/weChat")
@Controller
//@CrossOrigin
public class WeChatController {

    @Autowired
    private WeChatService weChatService;

    @GetMapping("/code")
    public String genraterCode() {
        String url = weChatService.genraterCode();
        return "redirect:" + url;
    }
    
}
